 <?php
	require_once('db_connect.php');
	
	$user_id = $_GET['user_id'];
	$query = "select * from friends where user_id='$user_id'";
	$data = mysqli_query($conn, $query)
		or die('facebook 친구 id 목록 가져오는 쿼리 실패');

	$friends = array();
	while ($row = mysqli_fetch_array($data)) {
		$a_friend = array('facebook_id' => $row['facebook_id']);
		array_push($friends, $a_friend);
	}
	mysqli_close($conn);
	echo json_encode($friends);
	exit;
 ?>